package com.varian.tool.log;

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import cn.hutool.core.util.StrUtil;
import com.varian.tool.Func;

/**
 * @author ben
 * @since 2024/7/19
 */
public class TraceIdMessageConverter extends ClassicConverter {
    @Override
    public String convert(ILoggingEvent event) {
        String traceId = Func.getTraceId();
        if (StrUtil.isNotBlank(traceId)) {
            return traceId;
        }
        return StrUtil.DASHED;
    }
}
